//
//  HWVerificationViewController.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/10/30.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWVerificationViewController.h"
#import "HWVerificationTableViewCell.h"
#import "HWXiuGaiEmailViewController.h"
#import "HWMobilePhoneDianhHuaViewController.h"

@interface HWVerificationViewController ()<UITableViewDataSource,UITableViewDelegate>
@property(strong,nonatomic) UITableView *mainaTableVie;
@property(strong,nonatomic) UILabel *wufayangzehLabel;

@end

@implementation HWVerificationViewController

-(UITableView *)mainaTableVie {

    if  (_mainaTableVie == nil) {

        _mainaTableVie = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, CF_NavHeight+57*2) style:UITableViewStylePlain];
        _mainaTableVie.delegate = self;
        _mainaTableVie.dataSource = self;
        _mainaTableVie.separatorStyle = UITableViewCellSeparatorStyleNone;
        
        _mainaTableVie.backgroundColor = [UIColor whiteColor];
       // _mainaTableVie.backgroundColor = RGB(241, 242, 244);
        
    }
    return   _mainaTableVie ;

}





- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setupUI];
}

// 设置UI
- (void)setupUI {
    
    self.navigationItem.title = @"账号验证";
    self.navigationItem.title = [HWjianzhiduiObject keylocalization:@"账号验证"];
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self.view addSubview:self.mainaTableVie];
    
    
    // 添加控件
    [self addViewControls];
    
}

- (void)addViewControls {
    
    
    
     self.wufayangzehLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, self.mainaTableVie.bottom+14, kScreenW, 40)];
     self.wufayangzehLabel.font = [UIFont systemFontOfSize:12];
     self.wufayangzehLabel.textColor = RGB(102  , 102, 102);
     self.wufayangzehLabel.text = @"无法验证？联系在线客服";
    self.wufayangzehLabel.text =  [HWjianzhiduiObject keylocalization:@"无法验证？联系在线客服"];
     self.wufayangzehLabel.textAlignment = NSTextAlignmentCenter;
       // self.namelabel.backgroundColor = [UIColor redColor];
     [self.view addSubview:self.wufayangzehLabel];
    
    
   
   
    
    
    
    
}



 



- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 2;
    
    
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath  {
    
    
    static NSString *cellID = @"cellID";
    HWVerificationTableViewCell *cell  = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell) {

        cell  =  [[NSBundle mainBundle]loadNibNamed:@"HWVerificationTableViewCell" owner:nil options:nil].lastObject;
        
        

    }
    
    cell.backgroundColor = [UIColor whiteColor];
    cell.selectionStyle =  UITableViewCellSelectionStyleNone;
    cell.nameLabel.textColor = RGB(51, 51, 51);
    if (indexPath.row == 0) {
    
        cell.nameLabel.text = @"通过手机号验证";
        cell.dibuLabel.text = @"可通过手机号+短信验证码登录";
        
        cell.nameLabel.text =  [HWjianzhiduiObject keylocalization: @"通过手机号验证"];
        
        cell.dibuLabel.text = [HWjianzhiduiObject keylocalization:@"可通过手机号+短信验证码登录"];
        
        
    } else if(indexPath.row == 1) {
        cell.nameLabel.text = @"通过邮箱验证";
        cell.dibuLabel.text = @"可通过邮箱地址重设密码";
        
        
        cell.nameLabel.text =  [HWjianzhiduiObject keylocalization:@"通过邮箱验证"];
        
        cell.dibuLabel.text = [HWjianzhiduiObject keylocalization: @"可通过邮箱地址重设密码"];
        
        
    }
    
    

    return  cell;

    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return  57;
    
    
    
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    
    
    if (indexPath.row == 0) {
        
        HWMobilePhoneDianhHuaViewController *MobilePhone = [[HWMobilePhoneDianhHuaViewController alloc]init];
        MobilePhone.panduanStr = @"1";
        [self.navigationController pushViewController:MobilePhone animated:YES];
        
        
    } else if (indexPath.row == 1) {
        
        HWXiuGaiEmailViewController *XiuGai = [[HWXiuGaiEmailViewController alloc]init];
        XiuGai.panduanStr = @"1";

        [self.navigationController pushViewController:XiuGai animated:YES];
        
        
        
    }
}






@end
